<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<div class="center-block p5 modify-email">
     <div id="warnEmailMessage" class="col-sm-12 text-error mb15"></div>
	<form role="form" class="form-horizontal p15 mt20">
		<div class="form-group mr10">
			<label class="sr-only">邮箱</label>
			<div class="input-group">
			   <!-- 修改邮箱时输入原邮箱，并且验证原邮箱 -->
			   <s:if test="#request.p_flag.equals('MODIFY')">
			      <input type="text" class="form-control" id="email" placeholder="请输入注册时的邮箱" aria-describedby="basic-addon2" readonly="readonly" value="<s:property value="#request.p_email"/>"/>
			       <span class="input-group-btn">
				      <input class="btn btn-info" type="button" id="emailVerifyBtn" value="发送验证码" onclick="iSendEmailOrPhoneRomdon('emailVerifyBtn','email','warnEmailMessage','verifyEmail')"/>
				   </span>
			   </s:if>
			   <!-- 未绑定邮箱的用户绑定邮箱，并且验证绑定的邮箱是否存在，如果存在给出提示框，并且不允许提交 -->
			   <s:elseif test="#request.p_flag.equals('BINGDING')">
			       <input type="text" class="form-control" id="email" placeholder="请输入常用邮箱" aria-describedby="basic-addon2"/>
			       <span class="input-group-btn"> 
				      <input class="btn btn-info" type="button" id="emailBindingBtn" value="发送验证码" onclick="iSendEmailOrPhoneRomdon('emailBindingBtn','email','warnEmailMessage','verifyEmail','subBtnBindingEmail')"/>
				  </span> 
			   </s:elseif>
			   <!-- 修改邮箱的用户验证原邮箱后，输入要修改的邮箱，同时验证修改的邮箱是否存在，如果存在给出提示框，并且不允许提交 -->
				<s:else>
				   <input type="text" class="form-control" id="email" placeholder="请输入常用邮箱" aria-describedby="basic-addon2"/>
			       <span class="input-group-btn"> 
				      <input class="btn btn-info" type="button" id="emailUpdateBtn" value="发送验证码" onclick="iSendEmailOrPhoneRomdon('emailUpdateBtn','email','warnEmailMessage','verifyEmail','subBtnUpdateEmail')"/>
				  </span> 
				</s:else>
			</div>
		</div>
		<div class="form-group">
			<label class="sr-only">验证码</label>
			 <input type="text" class="form-control" id="securityCode" placeholder="请输入收到的验证码" />
		</div>
		<s:if test="#request.p_flag.equals('MODIFY')">
		      <div class="form-group">
			      <input type="button" class="btn btn-info" onclick="verifyEmail('email','warnEmailMessage','securityCode')" value="提交"/>
		      </div>
		</s:if>
		<!-- 需要判断邮箱是否是唯一的提交 -->
		<s:elseif test="#request.p_flag.equals('BINGDING')">
		       <div class="form-group">
			      <input type="button" class="btn btn-info" onclick="modifyOrBindingEmail('email','warnEmailMessage','securityCode')" id="subBtnBindingEmail" value="提交"/>
		      </div>
		</s:elseif>
		<s:else>
		       <div class="form-group">
			      <input type="button" class="btn btn-info" onclick="modifyOrBindingEmail('email','warnEmailMessage','securityCode')" id="subBtnUpdateEmail" value="提交"/>
		      </div>
		</s:else>
	</form>
</div>
